<template>
  <avue-crud :data="data"
             :option="option">
    <template #menu-btn="{row}">
      <el-dropdown-item divided
                        @click="tip(row)">自定义按钮</el-dropdown-item>
    </template>
    <template #menu="{row}">
      <el-button text
                 type="primary"
                 icon="el-icon-user"
                 @click="tip(row)">自定义按钮</el-button>
    </template>
  </avue-crud>
</template>

<script>
export default {
  data () {
    return {
      data: [
        {
          name: '张三',
          sex: '男'
        }, {
          name: '李四',
          sex: '女'
        }, {
          name: '王五',
          sex: '女'
        }, {
          name: '赵六',
          sex: '男'
        }
      ],
      option: {
        menuType: 'menu',
        menuBtnTitle: '自定义名称',
        column: [
          {
            label: '姓名',
            prop: 'name'
          },
          {
            label: '性别',
            prop: 'sex'
          }
        ]
      }
    }
  },
  methods: {
    tip (row) {
      this.$message.success('自定义按钮' + JSON.stringify(row));
    }
  }
}
</script>